package com.itheima.tlias.mapper;


import com.itheima.tlias.entity.Dept;
import com.itheima.tlias.vo.DeptVo;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * depts 查
 * deleteDept 删
 * insert 增
 * getById   改之前获取前端传回来的id，并将数据回显
 * updateDept 改
 */
@Mapper
public interface DeptMapper {
   // @Select("select * from dept")
    List<DeptVo> depts() throws Exception;

    @Delete("delete from dept where id = #{id}")
    void deleteDept(Integer id);

    @Insert("insert into dept (name, create_time, update_time)values(#{name}, #{createTime}, #{updateTime})")
    void insert(Dept dept);

    @Select("select * from dept where id = #{id}")
    DeptVo getById(Integer id);

  //@Update("UPDATE dept  set name=#{name},update_time=#{updateTime} where id = #{id}")
    void updateDept(Dept dto);
}
